warning: reading whole file with levels into memory could slow down computation 
